<!DOCTYPE HTML>
{% load static %}
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="{% static 'h-ui/css/H-ui.min.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'h-ui.admin/css/H-ui.admin.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'lib/Hui-iconfont/1.0.8/iconfont.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'h-ui.admin/skin/default/skin.css' %}" id="skin" />
<link rel="stylesheet" type="text/css" href="{% static 'h-ui.admin/css/style.css' %}" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>授课计划管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 授课 <span class="c-gray en">&gt;</span> 授课计划 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="ˢ��" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<form action="{% url 'give_lessons:giveles_show' %}" method="post">
            {% csrf_token %}
             <input type="text" value='{{ start_date }}' name='start_date' onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" id="logmin" class="input-text Wdate" style="width:120px;">
            -
            <input type="text" value='{{ stop_date }}' name="stop_date" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" id="logmax" class="input-text Wdate" style="width:120px;">
            <input type="text" name="class_name" value="{{ class_name }}" id="" placeholder="请输入班级名称" style="width:250px" class="input-text class_name">
            <input type="hidden" name="search" value="true" class="hi" id="se">
            <button name="" id="search" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
        </form>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"> <a href="javascript:;" onclick="plan_add('添加授课计划','add/','650','500')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加授课计划</a></span> <span class="r">总数：<strong>{{ plan_list.count }}</strong> </span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="80">ID</th>
					<th width="80">授课计划</th>
                    <th width="80">班级</th>
					<th width="80">讲师</th>
					<th width="120">作业描述</th>
					<th width="75">作业检查时间</th>
                    <th width="75">授课时间</th>
					<th width="60">添加时间</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
                {% for plan in plan_list %}
                    <tr class="text-c">
                        <td><input type="checkbox" value="" name=""></td>
                        <td>{{ plan.id }}</td>
                        <td class="text-l">{{ plan.les_plan }}</td>
                        <td>{{ plan.class_grade_id.classname }}</td>
                        <td>{{ plan.teacher_id.realname }}</td>
                        <td>{{ plan.task_des }}</td>
                        <td>{{ plan.task_check_date|date:'Y-m-d h:i:s' }}</td>
                        <td>{{ plan.lessons_date|date:'Y-m-d' }}</td>
                        <td class="td-status"><span class="label label-success radius">{{ plan.add_date|date:'Y-m-d h:i:s' }}</span></td>
                        <td class="f-14 td-manage">
                            {% if not is_student %}
	                        <a style="text-decoration:none" class="ml-5" onClick="plan_edit('编辑计划','modify/?a={{ plan.id }}','750','600')" href="javascript:;" title="修改计划"><i class="Hui-iconfont">&#xe6df;</i></a>

	                        <a style="text-decoration:none" class="ml-5" onClick="know_add('添加知识点','know/add/?a={{ plan.id }}','750','600')" href="javascript:;">添加知识点</a>
	                        {% else %}
	                        <a style="text-decoration:none; " class="ml-5" href="know/?id={{ plan.id }}">查看知识点</a>
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
			</tbody>
		</table>
	</div>
</div>
<!--_footer ��Ϊ����ģ������ȥ-->
<script type="text/javascript" src="{% static 'lib/jquery/1.9.1/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'lib/layer/2.4/layer.js' %}"></script>
<script type="text/javascript" src="{% static 'h-ui/js/H-ui.min.js' %}"></script>
<script type="text/javascript" src="{% static 'h-ui.admin/js/H-ui.admin.js' %}"></script> <!--/_footer ��Ϊ����ģ������ȥ-->

<script type="text/javascript" src="{% static 'lib/My97DatePicker/4.8/WdatePicker.js' %}"></script>
<script type="text/javascript" src="{% static 'lib/datatables/1.10.0/jquery.dataTables.min.js' %}"></script>
<script type="text/javascript" src="{% static 'lib/laypage/1.2/laypage.js' %}"></script>
<script type="text/javascript">
    {% if messages %}
        {% for message in messages %}
            $.Huimodalalert('{{ message }}', 1000);
        {% endfor %}
    {% endif %}
$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//Ĭ�ϵڼ�������
	"bStateSave": true,//״̬����
	"pading":false,
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //�����е�������ʾ
	  {"orderable":false,"aTargets":[0,8]}// �������������
	]
});

/*��Ѷ-���*/
function plan_add(title,url,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
function know_add(title,url,w,h){
	layer_show(title,url,w,h);
}
/*��Ѷ-�༭*/
function plan_edit(title,url,w,h){
	layer_show(title,url,w,h);
}
/*��Ѷ-ɾ��*/
function article_del(obj,id){
	layer.confirm('ȷ��Ҫɾ����',function(index){
		$.ajax({
			type: 'POST',
			url: '',
			dataType: 'json',
			success: function(data){
				$(obj).parents("tr").remove();
				layer.msg('��ɾ��!',{icon:1,time:1000});
			},
			error:function(data) {
				console.log(data.msg);
			},
		});
	});
}

/*��Ѷ-���*/
function article_shenhe(obj,id){
	layer.confirm('提交审核', {
		btn: ['ͨ��','��ͨ��','ȡ��'],
		shade: false,
		closeBtn: 0
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_start(this,id)" href="javascript:;" title="��������">��������</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">�ѷ���</span>');
		$(obj).remove();
		layer.msg('�ѷ���', {icon:6,time:1000});
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_shenqing(this,id)" href="javascript:;" title="��������">��������</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">δͨ��</span>');
		$(obj).remove();
    	layer.msg('δͨ��', {icon:5,time:1000});
	});
}
/*��Ѷ-�¼�*/
function article_stop(obj,id){
	layer.confirm('ȷ��Ҫ�¼���',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_start(this,id)" href="javascript:;" title="����"><i class="Hui-iconfont">&#xe603;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">���¼�</span>');
		$(obj).remove();
		layer.msg('���¼�!',{icon: 5,time:1000});
	});
}

/*��Ѷ-����*/
function article_start(obj,id){
	layer.confirm('ȷ��Ҫ������',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_stop(this,id)" href="javascript:;" title="�¼�"><i class="Hui-iconfont">&#xe6de;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">�ѷ���</span>');
		$(obj).remove();
		layer.msg('�ѷ���!',{icon: 6,time:1000});
	});
}
/*��Ѷ-��������*/
function article_shenqing(obj,id){
	$(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">�����</span>');
	$(obj).parents("tr").find(".td-manage").html("");
	layer.msg('���ύ���룬���ĵȴ����!', {icon: 1,time:2000});
}

</script>
</body>
</html>